package com.basketball.gym.pojo;

import com.baomidou.mybatisplus.annotation.IdType;

import java.time.LocalDateTime;

import com.baomidou.mybatisplus.annotation.TableId;
import com.baomidou.mybatisplus.annotation.TableLogic;

import java.io.Serializable;

import com.fasterxml.jackson.annotation.JsonFormat;
import io.swagger.annotations.ApiModel;
import io.swagger.annotations.ApiModelProperty;
import lombok.Data;
import lombok.EqualsAndHashCode;
import lombok.experimental.Accessors;
import org.springframework.format.annotation.DateTimeFormat;

import javax.validation.constraints.Min;
import javax.validation.constraints.NotNull;

/**
 * <p>
 *
 * </p>
 *
 * @author 赵肖云
 * @since 2021-03-21
 */
@Data
@ApiModel(description = "Information对象")
public class Information implements Serializable {
    public interface insert {
    }

    public interface update {
    }


    @ApiModelProperty(value = "更新时间")
    @JsonFormat(pattern = "yyyy-MM-dd HH:mm:ss", timezone = "GMT+8")
    @DateTimeFormat(pattern = "yyyy-MM-dd HH:mm:ss")
    private LocalDateTime updateAt;

    @ApiModelProperty(value = "创建时间")
    @JsonFormat(pattern = "yyyy-MM-dd HH:mm:ss", timezone = "GMT+8")
    @DateTimeFormat(pattern = "yyyy-MM-dd HH:mm:ss")
    private LocalDateTime createAt;

    @ApiModelProperty(value = "用户ID", example = "1")
    private Integer userId;

    @ApiModelProperty(value = "紧急电话")
    private String emergencyPhone;

    @NotNull(message = "age不能为空", groups = {insert.class})
    @Min(value = 0, message = "age不能小于0", groups = {insert.class, update.class})
    @ApiModelProperty(value = "年龄", example = "1")
    private Integer age;
    @NotNull(message = "sex不能为空", groups = {insert.class})
    @ApiModelProperty(value = "性别")
    private Integer sex;

    @NotNull(message = "name不能为空", groups = {insert.class})
    @ApiModelProperty(value = "姓名")
    private String name;

    @ApiModelProperty(value = "信息ID", example = "1")
    @TableId(value = "id", type = IdType.AUTO)
    private Integer id;


}
